package com.hpeng.basic.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.hpeng.basic.dao.AccountingSubjectDao;
import com.hpeng.basic.service.AccountingSubjectManager;
import com.hpeng.sys.model.AccountingSubject;
import com.hpeng.util.Pagination;

@Component("accountingSubjectManager")
public class AccountingSubjectManagerImpl implements AccountingSubjectManager {
	@Resource
	private AccountingSubjectDao accountingSubjectDao;

	public AccountingSubject addAccountingSubject(
			AccountingSubject accountingSubject) {

		return accountingSubjectDao.save(accountingSubject);
	}

	public void delAccountingSubject(String subid) {
		accountingSubjectDao.remove(subid);
	}

	public List<AccountingSubject> findAccountingSubject() {
		String hql = "from AccountingSubject where substatus='Y'";	
		return accountingSubjectDao.getByHql(hql);
	}

	public AccountingSubject findAccountingSubjectById(String subid) {
		return accountingSubjectDao.get(subid);
	}

	public void updateAccountingSubject(AccountingSubject accountingSubject) {
		accountingSubjectDao.update(accountingSubject);
	}

	public Pagination<AccountingSubject> getPagination(int pageNumber,
			String[] hql, String order) {
		return accountingSubjectDao.getPagination(pageNumber, hql, order);
	}

}
